<layout name="layout" />
<div>
	<form class="form-inline" role="form" action="/user/userList" mothed="get" id="search_form">
		<div class="input-group ">
			<span class="input-group-addon">用户名</span>
			<input type="text" class="form-control" placeholder="用户名" autocomplete="off" name="search[nick]" value="{$nick}"/>
		</div>
		<input type="hidden" id="search-order" name="order" value="{$order}" />
		<input type="hidden" id="search-asc" name="asc" value="{$asc}" />
		<button type="submit" class="btn btn-default">查询</button>
	</form>
</div>
<div style="margin-top:20px;">
	<table class="table">
		<thead>
			<tr>
				<th><a href="javascript:;">用户名</a></th>
				<th class="setOrder <if condition="$order eq 'status'"><if condition="$asc eq 'DESC'">search-DESC<else/>search-ASC</if></if>" data-order="status" data-order-asc="DESC"><a href="javascript:;">状态</a></th>
				<th class="setOrder <if condition="$order eq 'tel'"><if condition="$asc eq 'DESC'">search-DESC<else/>search-ASC</if></if>" data-order="tel" data-order-asc="DESC"><a href="javascript:;">联系电话</a></th>
				<th class="setOrder <if condition="$order eq 'qq'"><if condition="$asc eq 'DESC'">search-DESC<else/>search-ASC</if></if>" data-order="qq" data-order-asc="DESC"><a href="javascript:;">QQ号码</a></th>
				<th class="setOrder <if condition="$order eq 'created_time'"><if condition="$asc eq 'DESC'">search-DESC<else/>search-ASC</if></if>" data-order="created_time" data-order-asc="DESC"><a href="javascript:;">购买时间</a></th>
				<th class="setOrder <if condition="$order eq 'purchase_expires'"><if condition="$asc eq 'DESC'">search-DESC<else/>search-ASC</if></if>" data-order="purchase_expires" data-order-asc="DESC"><a href="javascript:;">到期时间</a></th>
				<th class="setOrder <if condition="$order eq 'login_time'"><if condition="$asc eq 'DESC'">search-DESC<else/>search-ASC</if></if>" data-order="login_time" data-order-asc="DESC"><a href="javascript:;">最近登录时间</a></th>
			</tr>
		</thead>
		<tbody>
			<foreach name="users" item="user">
			<tr>
				<td><a href="{$user['href']}" target="_blank">{$user['nick']}</a></td>
				<td>{$user['status']}</td>
				<td>{$user['tel']|display_str}</td>
				<td>{$user['qq']|display_str}</td>
				<td>{$user['created_time']|display_str}</td>
				<td>{$user['purchase_expires']|display_str}</td>
				<td>{$user['login_time']|display_str}</td>
			</tr>
			</foreach>
		</tbody>
	</table>
</div>

<if condition="$totalPage != 0">
<div class="page-content">
	<nav>
		<ul class="pagination">
			<if condition="$currentPage != 1">
			<li class=""><a href="/user/userList?page={$lastPage}{$current_search}">&laquo;</a></li>
			<else/>
			<li class="disabled"><a href="javascript:;">&laquo;</a></li>
			</if>
			<for start="1" end="$totalPage+1">
			<li class="<if condition="$currentPage == $i">active</if>"><a href="<if condition="$currentPage == $i">javascript:;<else/>/user/userList?page={$i}{$current_search}</if>">{$i}</a></li>
			</for>
			<if condition="$currentPage != $totalPage">
			<li class=""><a href="/user/userList?page={$nextPage}{$current_search}">&raquo;</a></li>
			<else/>
			<li class="disabled"><a href="javascript:;">&raquo;</a></li>
			</if>
		</ul>
	</nav>
</div>
</if>